<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>修改密码</title>
		<link rel="stylesheet" href="../../plugins/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../common.css">
		<style>

		</style>
	</head>
	<body>
		<div class="layui-fluid form-top-kg" id="resetpassword">
			<div class="layui-row">
				<div class="layui-col-md-offset1 layui-col-md4">
					<div class="layui-form-query">
						<form class="layui-form" action="" id="resetpass">
							<div class="layui-form-item" style="position:relative">
								<label class="layui-form-mid">原密码：</label>
								<div class="layui-input-block">
									<input type="text" name="OldPwd" required lay-verify="required" placeholder="请输入原密码" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item" style="position:relative">
								<label class="layui-form-mid">设置密码：</label>
								<div class="layui-input-block">
									<input type="text" name="NewPwd" id="repass" lay-verify="pass" placeholder="请输入新密码" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item" style="position:relative">
								<label class="layui-form-mid">确认密码：</label>
								<div class="layui-input-block">
									<input type="text" name="title" lay-verify="contactsresetpass" placeholder="请再次输入密码" autocomplete="off" class="layui-input">
								</div>
							</div>
							<br/>
							<div class="layui-form-item">
								<div class="layui-input-block">
									<button class="layui-btn layui-btn-lg layui-btn-normal" lay-submit lay-filter="resetp">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<script src="../../plugins/layui/layui.js"></script>
		<script src="../../plugins/vue.min.js"></script>
		<script src="../../common.js"></script>
		<script>
			// 基础数据
			var vm = new Vue({
				el: "#resetpassword",
				data: {

				},
				created() {
					layui.use(['jquery', 'form', 'ajaxmod', 'layer', 'verifymod'], function() {

						var $ = layui.jquery,
							form = layui.form,
							layer = layui.layer,
							ajaxmod = layui.ajaxmod,
							verifymod = layui.verifymod;

						//监听提交
						form.on('submit(resetp)', function(data) {
							ajaxmod.layuiPost("/api/sys/account/ResetMyPwd", data.field, function(res) {
								if(res.success) {
									layer.msg('操作成功', {
										icon: 1
									});
								} else {
									layer.msg(res.message, {
										icon: 2
									});
								}
							})
							return false;
						});
					});
				},
			})
		</script>
	</body>
</html>